package hr.ctg.service.dao;

import hr.ctg.domain.model.TipObjekta;
import hr.jpa.dao.GenericDAOImpl;

import java.util.List;

import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Name;

@AutoCreate
@Name("tipObjektaDAO")
public class TipObjektaDAO extends GenericDAOImpl<TipObjekta, Integer> {

	@SuppressWarnings("unchecked")
	public List<TipObjekta> findByIdMjesta(final Integer idMjesta) {
		return entityManager.createNamedQuery("TipObjekta.findByIdMjesta")
		.setParameter(1, idMjesta).getResultList();
	}

	@SuppressWarnings("unchecked")
	public List<TipObjekta> findByIdZupanije(final Integer idZupanije) {
		return entityManager.createNamedQuery("TipObjekta.findByIdZupanije")
				.setParameter(1, idZupanije).getResultList();
	}

	@SuppressWarnings("unchecked")
	public List<TipObjekta> findByIdOtoka(final Integer idOtoka) {
		return entityManager.createNamedQuery("TipObjekta.findByIdOtoka")
				.setParameter(1, idOtoka).getResultList();
	}

	@SuppressWarnings("unchecked")
	public List<TipObjekta> findByObjekti() {
		return entityManager.createNamedQuery("TipObjekta.findByObjekti")
				.getResultList();
	}
}
